package game_play_strategy.tools;

import java.util.ArrayList;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class HeroAttack extends ListActivity {

	
/** Called when the activity is first created. */

	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		// Create an array of Strings, that will be put to our ListActivity
		ArrayList<String> enemys_list = getIntent().getStringArrayListExtra("enemys_around_squares");

		this.setListAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, enemys_list));
		
		//
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		// Get the item that was clicked
		Object o = this.getListAdapter().getItem(position);
		String keyword = o.toString();

		Intent resultIntent = new Intent(HeroAttack.this, GameScreen.class);
		resultIntent.putExtra("square", keyword);
		setResult(ListActivity.RESULT_OK, resultIntent);
		finish();
	}
}